<?php

namespace App\Observers;

use App\Models\Product;

class ProductObserver
{   
    public function saving(Product $product)
    {
        if(is_array($product->unallowed_area)){
            
            $product->unallowed_area = empty($product->unallowed_area) ? '' : implode(',',$product->unallowed_area );
        }   
      
    }


    
    public function deleted(Product $product)
    {
	    $product->delFromCache();
    }
}
